﻿using System.Collections.Generic;
using System.Windows;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Utils;

namespace UtilsIntegrationTests
{
	[TestClass]
	public class Math2UT
	{
		[TestMethod]
		public void SimpleCalculation1Point()
		{
			List<Point> function = new List<Point>();
			function.Add(new Point(1, 0));
			function.Add(new Point(2, 1));

			Assert.AreEqual(1.4142135623731, Math2.CalculateLength(function), 0.001);
		}

		[TestMethod]
		public void SimpleCalculation2Points()
		{
			List<Point> functionA = new List<Point>();
			functionA.Add(new Point(1, 0));
			functionA.Add(new Point(2, 1));
			functionA.Add(new Point(3, 2));

			List<Point> functionB = new List<Point>();
			functionB.Add(new Point(1, 0));
			functionB.Add(new Point(3, 2));

			Assert.AreEqual(Math2.CalculateLength(functionA), Math2.CalculateLength(functionB));
		}

	}
}
